<!--
 * @Author: humengchuan 531537052@qq.com
 * @Date: 2024-05-21 13:39:15
 * @LastEditors: humengchuan 531537052@qq.com
 * @LastEditTime: 2024-05-31 11:13:38
 * @FilePath: \project\record-work-time\src\pages\mine\index.vue
 * @Description: 
-->
<template>
    <view>
        我的
        <view class="button" @click="addHandleTest">add button</view>
        <view class="button" @click="handleTest">button</view>
    </view>
</template>

<script setup>
const db = uniCloud.database()

const handleTest = async () => {
    // let res = await db.collection('article-list').get()
    // console.log('test', res)
    uniCloud.callFunction({
        name: 'getArticalList',
        data: {
            page: 1,
            size: 2
        }
    }).then(res => {
        console.log('%c [ res ]-27', 'font-size:13px; background:pink; color:#bf2c9f;', res)
    }
    )
}

const addHandleTest = async () => {
    let res = await db.collection('article-list').add({
        title: 'test11111',
        content: 'test fist add content1aaaa',
        from: 'test 2'
    })
    console.log('test', res)
}
</script>

<style lang="scss" scoped>
.button {
    width: 200rpx;
    height: 200rpx;
    text-align: center;
    line-height: 200rpx;
    background-color: pink;
    border-radius: 100rpx;
}
</style>